package com.lh.domian;

import com.lh.enums.AppHttpCodeEnum;

/**
 * @Author LuoHang
 * @Date 2022-08-26 00:40
 **/
public class ResponseResults {
    private Integer code;
    private String msg;
    private Object data;

    public ResponseResults(){
        this.code = AppHttpCodeEnum.SUCCESS.getCode();
        this.msg = AppHttpCodeEnum.SUCCESS.getMsg();
    }

    public ResponseResults(Integer code,Object data){
        if ( code == AppHttpCodeEnum.SUCCESS.getCode()){
            this.code = AppHttpCodeEnum.SUCCESS.getCode();
            this.msg = AppHttpCodeEnum.SUCCESS.getMsg();
            this.data = data;
        } else if (code == AppHttpCodeEnum.NEED_LOGIN.getCode()) {
            this.code = AppHttpCodeEnum.SUCCESS.getCode();
            this.msg = AppHttpCodeEnum.SUCCESS.getMsg();
        }
    }

    public ResponseResults(Integer code,String msg,Object data){
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
